<style>

.odds{
	background: red;
}

.even
{
	background-color: blue;
}

</style>

<script>

var cod;
var todos = 1;

function saveComent()
{
	//alert(cod + $("#text_coment").val());
	$.post("<?php echo $this->base; ?>/pedido/savecoment", {caf04_cod: cod, caf04_cod_item: <?php echo $this->arr_coment[0]["caf04_cod_item"]; ?>, caf04_cod_prod: <?php echo $this->arr_coment[0]["caf04_cod_prod"]; ?>, caf04_coment: $("#text_coment").val(), all: todos}, function(){$('#coment_all').hide(); listProd();});
}

$(function(){

	$("#prods").tablesorter({widgets: ['zebra']});
	
});

</script>

<?php echo $this->render("helpers/keyboard.phtml"); ?>

<div id="coment_all">
	<div class="blk_screen" style="opacity: 0.8; position: fixed; z-index: 980; width: 100%; height: 100%; background-color: white; top: 0; left: 0;"></div>
	<div class="ui-corner-all" style="border: 1px solid #B0ADAD; padding: 10px; background: #E5E5E5; position: fixed; z-index: 981; top: 30px; width: 500px; left: 50%; margin-left: -250px;">
		<div class="ui-corner-all" style="background-color: #CFCFCF; padding: 5px 0 5px 0; margin-bottom: 10px;">
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<input type="radio" checked="checked" onclick="todos = 1; $('#com_all').slideUp('fast');" name="select_coment" />
					</td>
					<td>
						Aplicar Comentario a todos itens
					</td>
					<td>
						<input type="radio" name="select_coment" onclick="todos = 0; $('#com_all').slideDown('fast');" />
					</td>
					<td>	
						Aplicar Comentario a iten especifico
					</td>
				</tr>
			</table>
			<div id="com_all" style="display: none;">
				<hr style="border-top: 1px solid #E5E5E5; margin-top: 5px;" />
				<table id="prods" class="tablesorter" width="100%">
					<tbody>
					<?php 
					foreach ($this->arr_coment as $key => $val)
					{
					?>
					<tr>
						<td width="1%">
							<input type="radio" onclick="(cod = <?php echo $val["caf04_cod"]; ?>)" value="<?php echo $val["caf04_cod"]; ?>" name="prod_radio" />
						</td>
						<td>
							<?php echo "{$val["caf05_prod"]}({$val["caf05_car"]})"; ?>
						</td>
						<td>
							<i><?php echo $val["caf04_coment"]; ?></i>
						</td>
					</tr>
					<?
					}
					?>
					</tbody>
				</table>
			</div>
		</div>
		<textarea onclick="showKeyboard();" id="text_coment" class="ui-corner-all" style="width: 497px; border: 1px solid gray;" rows="10" cols=""></textarea>
		<hr style="margin: 10px 0 10px 0;" />
		<div>
			<div class="button ui-corner-all" onclick="saveComent(); $('#div_key').fadeOut();" style="text-align: center; float: left; padding: 20px; width: 201px;">
				<b>Salvar</b>
			</div>
			<div class="button ui-corner-all" onclick="$('#coment_all').hide(); $('#div_key').fadeOut();" style="text-align: center; padding: 20px; margin-left: 256px; width: 201px;">
				<b>Cancelar</b>
			</div>
		</div>
	</div>
</div>